<?php 
return array (
  'table' => 'comments',
  'engine' => 'InnoDB',
  'rev_control' => false,
  'link_title' => 'text',
  'save_history' => false,
  'title' => 'Comments',
  'fields' => array (
    'object_name' => array (
      'title' => 'Commented object name',
      'db_type' => 'bigint',
      'db_isNull' => false,
      'db_default' => 0,
      'required' => true,
    ),
    'object_id' => array (
      'title' => 'Commented object id',
      'db_type' => 'bigint',
      'db_isNull' => false,
      'db_default' => 0,
      'required' => true,
    ),
    'user_id' => array (
      'title' => 'Author',
      'required' => true,
      'type' => 'link',
      'link_config' => array (
        'link_type' => 'object',
        'object' => 'user',
      ),
    ),
    'parent_id' => array (
      'title' => 'Parent Coment',
      'required' => false,
      'type' => 'link',
      'link_config' => array (
        'link_type' => 'object',
        'object' => 'comment',
      ),
    ),
    'text' => array (
      'title' => 'Block content',
      'db_type' => 'longtext',
      'db_isNull' => false,
      'required' => true,
    ),
    'is_hidden' =>array (
       'title' => 'Is Hidden',
       'required'=>false,
       'db_type' => 'boolean',
       'db_isNull' => false,
       'db_default' =>0
    ),
  ),
  'indexes' => array (
    'object_id' => array (
      'columns' => array ('object_name','object_id'),
      'unique' => false,
      'fulltext' => false,
      'PRIMARY' => false,
    ),
    'user' => array (
      'columns' =>  array ('user_id'),
      'unique' => false,
      'fulltext' => false,
      'PRIMARY' => false,
    ),
  ),
); 